package com.sky.mapper;

import com.sky.annotation.autoFile;
import com.sky.entity.DishFlavor;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {
    void saveDishFlavor(List<DishFlavor> flavors);

    // 根据菜品id删除菜品口味数据
//    void delete(List<Integer> ids);

    @autoFile(value = OperationType.UPDATE)
    //修改菜品
    void update(List<DishFlavor> list);

    @Delete("delete from dish_flavor where dish_id = #{id}")
    //删除菜品口味
    void delete(long id);

    //根据菜品id查询口味
    @Select("select * from dish_flavor where dish_id = #{id}")
    List<DishFlavor> getByDishId(Long id);
}
